import React, { useEffect } from 'react';
import './index.less';
import Graph from './components/graph';
import companyInfoData from './components/companyInfo';
import { GrapType } from './util';

export default (props: any) => {
  const init = () => {
    let {
      qyxxId = '1234567894555554ddsad',
      companyName = '成都数联铭品科技有限公司',
      creditCode = '--',
    } = props;
    companyInfoData.companyName = companyName;
    companyInfoData.creditCode = creditCode === 'nc' ? '--' : creditCode;
    const params: GrapType = {
      id: 'cig',
      data: companyInfoData,
      clickBack: (data: string) => {
        // this.props.history.push(`/holographicPortrait/search/subjectDetail/${data}/${qyxxId}`);
      },
    };
    new Graph(params);
  };
  useEffect(() => {
    init();
  }, []);
  return (
    <div className="companyInfoGraph-index">
      <div className="graphWraper">
        <div className="topBanner"></div>
        <div className="graph" id="cig"></div>
        <div className="bottomBanner"></div>
      </div>
    </div>
  );
};
